Skip to content

fix(tests): grep -c count duplication on zero matches - #4

Merged
FvdHMBAI merged 4 commits into
mainfrom
fix/grep-count-bug
Aug 2, 2026
Merged

fix(tests): grep -c count duplication on zero matches#4
FvdHMBAI merged 4 commits into
mainfrom
fix/grep-count-bug

Conversation

@FvdHMBAI

@FvdHMBAI FvdHMBAI commented Aug 2, 2026

Copy link
Copy Markdown
Owner

Summary

  • grep -c outputs 0 and exits with code 1 when no matches found
  • || echo "0" then added a second 0, making the variable "0\n0"
  • [[ "0\n0" -eq 0 ]] fails with syntax error, marking all shellcheck tests as FAIL
  • Fix: || true instead of || echo "0"

Test plan

  • All 68 tests pass locally
  • Shellcheck tests now correctly report PASS for clean files

Frederik and others added 4 commits August 2, 2026 10:05
- Add 61-test suite covering config, helpers, locks, categories, schema, language
- Add GitHub Actions CI with shellcheck, tests, and language enforcement
- Rewrite README with architecture diagram, competitor comparison, FAQ
- Add examples directory with sample report, scheduling config, multi-repo setup
- Add CHANGELOG.md tracking all versions
- All code verified English-only

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Fix SC2155: declare and assign separately in worker.sh, coordinator.sh
- Fix SC2034: suppress unused-var warnings in config.sh (sourced file)
- Fix language check: use byte-level grep to avoid self-detection in tests
- Rename unused read vars with _ prefix

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ated it

The shellcheck test captured "0\n0" instead of "0" because grep -c
outputs the count (0) even on exit code 1, then || echo "0" added
a second zero. Changed to || true.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016Sw2Ti3a4Ad8U6JuAyNib1
@FvdHMBAI
FvdHMBAI merged commit 6188d19 into main Aug 2, 2026
3 checks passed
@FvdHMBAI
FvdHMBAI deleted the fix/grep-count-bug branch August 2, 2026 08:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant